package com.tubang.logistics.eum;

import java.util.Arrays;

public enum OrderStatusEnum {
	RELEASE_WAIT(107, "待发布"),
	OVERRULE_ORDER(106, "驳回运单"),
	EXCEPTION(105, "异常运单"),
	FINISH(104, "已完成"),
	CHECK_WAIT(103, "待确认"),
	DELIVERY(102, "运输中"),
	TAKE_WAIT(101, "待提货"),
	GET_WAIT(100, "待接单"),
	QUOTED(99, "报价中"),
	REVIEW_WAIT(98, "待审核"),
	BIDDING(97, "竞价中"),
	REFUSE_ORDER(961, "拒绝接单"),
	ASSIGNED_ORDER(96, "指派中"),
	GRAB_ORDER(95, "抢单中"),
	;

	private Integer _code;
	private String _text;

	OrderStatusEnum(Integer code, String text) {
		this._code = code;
		this._text = text;
	}

	public Integer getCode() {
		return _code;
	}

	public String getText() {
		return _text;
	}

	public static OrderStatusEnum getVal(Integer code) {

		return Arrays.stream(OrderStatusEnum.values()).filter(c -> code.equals(c.getCode())).findFirst().orElse(null);

	}
}
